/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.task.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.task.model.*;
import com.tech15.task.dao.*;
import com.tech15.task.service.*;
import com.tech15.task.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "TASK_RETURN_PROCESS")
public class TaskReturnProcess extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "TaskReturnProcess";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_USERID = "用户";
	public static final String ALIAS_ZT = "状态";
	public static final String ALIAS_FSSJ = "发送时间";
	public static final String ALIAS_CLSJ = "处理时间";
	public static final String ALIAS_CLJG = "处理结果";
	public static final String ALIAS_TRID = "任务退回id";
	
	//date formats
	public static final String FORMAT_FSSJ = DATE_FORMAT;
	public static final String FORMAT_CLSJ = DATE_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	
	private Long id;
    /**
     * 用户       db_column: USERID 
     */ 	
	
	private Long userid;
    /**
     * 状态       db_column: ZT 
     */ 	
	@Max(127)
	private Integer zt;
    /**
     * 发送时间       db_column: FSSJ 
     */ 	
	
	private java.util.Date fssj;
    /**
     * 处理时间       db_column: CLSJ 
     */ 	
	
	private java.util.Date clsj;
    /**
     * 处理结果       db_column: CLJG 
     */ 	
	@Length(max=600)
	private java.lang.String cljg;
    /**
     * 任务退回id       db_column: TRID 
     */ 	
	
	private Long trid;
	//columns END


	public TaskReturnProcess(){
	}

	public TaskReturnProcess(
		Long id
	){
		this.id = id;
	}

	

	public void setId(Long value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getId() {
		return this.id;
	}
	
	@Column(name = "USERID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getUserid() {
		return this.userid;
	}
	
	public void setUserid(Long value) {
		this.userid = value;
	}
	
	@Column(name = "ZT", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
	public Integer getZt() {
		return this.zt;
	}
	
	public void setZt(Integer value) {
		this.zt = value;
	}
	
	@Transient
	public String getFssjString() {
		return DateConvertUtils.format(getFssj(), FORMAT_FSSJ);
	}
	public void setFssjString(String value) {
		setFssj(DateConvertUtils.parse(value, FORMAT_FSSJ,java.util.Date.class));
	}
	
	@Column(name = "FSSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getFssj() {
		return this.fssj;
	}
	
	public void setFssj(java.util.Date value) {
		this.fssj = value;
	}
	
	@Transient
	public String getClsjString() {
		return DateConvertUtils.format(getClsj(), FORMAT_CLSJ);
	}
	public void setClsjString(String value) {
		setClsj(DateConvertUtils.parse(value, FORMAT_CLSJ,java.util.Date.class));
	}
	
	@Column(name = "CLSJ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getClsj() {
		return this.clsj;
	}
	
	public void setClsj(java.util.Date value) {
		this.clsj = value;
	}
	
	@Column(name = "CLJG", unique = false, nullable = true, insertable = true, updatable = true, length = 600)
	public java.lang.String getCljg() {
		return this.cljg;
	}
	
	public void setCljg(java.lang.String value) {
		this.cljg = value;
	}
	
	@Column(name = "TRID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getTrid() {
		return this.trid;
	}
	
	public void setTrid(Long value) {
		this.trid = value;
	}
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Userid",getUserid())
			.append("Zt",getZt())
			.append("Fssj",getFssj())
			.append("Clsj",getClsj())
			.append("Cljg",getCljg())
			.append("Trid",getTrid())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof TaskReturnProcess == false) return false;
		if(this == obj) return true;
		TaskReturnProcess other = (TaskReturnProcess)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

